package Strategy;

/**
 * @ProjectName: 23种设计模式
 * @Package: Strategy
 * @ClassName: Cat
 * @Author: renhan
 * @Description:
 * @Date: 2020/11/10 16:43
 * @Version: 1.0
 */
public class Cat  {
    int weight, height;

    public Cat(int weight, int height) {
        this.weight = weight;
        this.height = height;
    }

    public int compareTo (Cat c) {
        if (this.weight < c.weight) {return -1;}
        else if (this.weight > c.weight) {return 1;}
        else { return 0; }
    }

    @Override
    public String toString() {
        return "Cat{" +
                "weight=" + weight +
                ", height=" + height +
                '}';
    }
}
